home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / dev / src / td01_src.lha / td_r0.1 / sl3 / source / dummy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-17  |  7.3 KB  |  286 lines

  1. /*
  2. ** Ansi C includes
  3. */
  4. #include <math.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8.  
  9. /*
  10. ** Amiga includes
  11. */
  12. #include <dos/dos.h>
  13. #include <dos/stdio.h>
  14.  
  15. #include <clib/dos_protos.h>
  16.  
  17. /*
  18. ** Project includes
  19. */
  20. #include "tdo_public.h"
  21. #include "compiler.h"
  22. #include "tdo.h"
  23.  
  24. /**************************** Defines *******************************/
  25.  
  26. /*********************** Type definitions ***************************/
  27.  
  28. /*************************** Variables ******************************/
  29.  
  30. /********************** Private functions ***************************/
  31.  
  32. /********************** Public functions ****************************/
  33.  
  34. /****** geoa.library/tdo3XSave ******************************************
  35. *   NAME    
  36. *     tdo3XSave -- Saves the mesh as a 3D file.
  37. *
  38. *   SYNOPSIS
  39. *    error = tdo3XSave( meshhandle,filename,screen)
  40. *                       D1         D2        A0
  41. *
  42. *    ULONG tdo3XSave
  43. *         ( ULONG,STRPTR,struct Screen " );
  44. *
  45. *   FUNCTION
  46. *    The mesh will be saved in a 3 dimensional representation in the
  47. *    filename, without existence checks.
  48. *    The screen parameter is optional and only used if non-NULL, to
  49. *    display a window with additional or special parameters needed to
  50. *    save the mesh, or messages.
  51. *   INPUTS
  52. *     meshhandle    - A valid handle of a mesh.
  53. *    filename      - Name of the file to create.
  54. *    screen        - Pointer to the work screen.
  55. *    
  56. *   RESULT
  57. *     error - RCNOERROR      if all went well.
  58. *            RCNOTIMPL      if the function is not implemented.
  59. *            RCNOMEMORY     if there is not enough memory. 
  60. *            RCWRITEDATA    if an error occured while writing data, no more space.
  61. *            RCOVERFLOW     if the mesh is to extensive for this format.
  62. *            RCNOMATERIAL   if there are no materials, but they are expected.
  63. *           RCNOPART       if there are no parts, but they are expected.
  64. *            RCNOPOLYGON    if there are no polygons, but they are expected.
  65. *            RCNOVERTEX     if there are no vertices, but they are expected.
  66. *            IoErr()        if possible you will get this.
  67. *            tdo errors     if a tdo call failed.
  68. *   EXAMPLE
  69. *    error = tdo3XSave(meshhandle,"ram:test",NULL);
  70. *
  71. *   NOTES
  72. *    By setting the meshhandle to 0 the function returns RCNOERROR if
  73. *    it is implemented or RCNOTIMPL if not !
  74. *
  75. *   BUGS
  76. *   SEE ALSO
  77. ******************************************************************************
  78. *
  79. */
  80. ULONG __saveds ASM tdo3XSave(register __d1 ULONG meshhandle,
  81.                             register __d2 STRPTR filename,
  82.                             register __a0 struct Screen *screen) {
  83.     return(RCNOTIMPL);
  84. }
  85.  
  86. /****** geoa.library/tdo3XLoad ******************************************
  87. *   NAME    
  88. *     tdo3XLoad -- Load a 3D file and creates a mesh.
  89. *
  90. *   SYNOPSIS
  91. *    error = tdo3XLoad( meshhandle,filename,erroffset,screen)
  92. *                       D1         D2       D3         A0
  93. *
  94. *    ULONG tdo3XLoad
  95. *         ( ULONG,STRPTR,ULONG *,struct Screen " );
  96. *
  97. *   FUNCTION
  98. *    A file which contains a 3 dimensional representation
  99. *    will be examined for all known elements and converted into the
  100. *    mesh.
  101. *    The screen parameter is optional and only used if non-NULL, to
  102. *    display a window with additional or special parameters needed to
  103. *    save the mesh or messages.
  104. *    If an error occurs, erroffset contains the file offset in lines for
  105. *    ascii files and bytes for binary formats.
  106. *   INPUTS
  107. *     meshhandle    - A valid handle of a mesh.
  108. *    filename      - Name of the file to load.
  109. *    erroffset     - Offset where a read error occured.
  110. *    screen        - Pointer to the work screen.
  111. *    
  112. *   RESULT
  113. *     error - RCNOERROR       if all went well.
  114. *            RCNOTIMPL       if the function is not implemented.
  115. *            RCNOMEMORY      if there is not enough memory. 
  116. *            RCUNKNOWNFORMAT if the file format is unknown.
  117. *            RCNOFILE        if the file is not found.
  118. *            RCREADDATA      if an error occured while reading data.
  119. *            RCNOMATERIAL    if there are no materials, but they are expected.
  120. *           RCNOPART        if there are no parts, but they are expected.
  121. *            RCNOPOLYGON     if there are no polygons, but they are expected.
  122. *            RCNOVERTEX      if there are no vertices, but they are expected.
  123. *            IoErr()         if possible you will get this.
  124. *            tdo errors      if a tdo call failed.
  125. *   EXAMPLE
  126. *    error = tdo3XLoad(meshhandle,"ram:test",NULL);
  127. *
  128. *   NOTES
  129. *    By setting the meshhandle to 0 the function returns RCNOERROR if
  130. *    it is implemented or RCNOTIMPL if not !
  131. *
  132. *   BUGS
  133. *   SEE ALSO
  134. ******************************************************************************
  135. *
  136. */
  137. ULONG __saveds ASM tdo3XLoad(register __d1 ULONG meshhandle,
  138.                             register __d2 STRPTR filename,
  139.                             register __d3 ULONG *erroffset,
  140.                             register __a0 struct Screen *screen) {
  141.  
  142.     ULONG mesh;
  143.  
  144.     mesh=meshhandle;
  145.  
  146.     // we were asked for implementation
  147.     if(mesh==0) {
  148.         return(RCNOERROR);
  149.     }
  150.  
  151.     return(RCNOERROR);
  152. }
  153.  
  154. /****** geoa.library/tdo3XCheckFile ******************************************
  155. *   NAME    
  156. *     tdo3XCheckFile -- Checks if the file is in the format we expected to load.
  157. *
  158. *   SYNOPSIS
  159. *    error = tdo3XLoad( filename )
  160. *                       D1
  161. *
  162. *    ULONG tdo3XCheckFile
  163. *         ( STRPTR );
  164. *
  165. *   FUNCTION
  166. *    The file its header will be examinated to verify if it is the
  167. *    file format we expect to read with the load function.
  168. *   INPUTS
  169. *    filename      - Name of the file to load.
  170. *    
  171. *   RESULT
  172. *     error - RCNOERROR       if all went well.
  173. *            RCUNKNOWNFORMAT if the file format is unknown.
  174. *            RCNOFILE        if the file is not found.
  175. *            RCREADDATA      if an error occured while reading data.
  176. *            IoErr()         if possible you will get this.
  177. *   EXAMPLE
  178. *    error = tdo3XCheckFile("ram:test");
  179. *
  180. *   NOTES
  181. *
  182. *   BUGS
  183. *   SEE ALSO
  184. ******************************************************************************
  185. *
  186. */
  187. ULONG __saveds ASM tdo3XCheckFile(register __d2 STRPTR filename) {
  188.  
  189.     return(RCUNKNOWNFORMAT);
  190. }
  191.  
  192. /****** geoa.library/tdo3XExt ******************************************
  193. *   NAME    
  194. *     tdo3XExt -- Returns the default extension of the file format.
  195. *
  196. *   SYNOPSIS
  197. *    ext = tdo3XExt ( )
  198. *
  199. *    SRPTR tdo3XExt
  200. *         ( );
  201. *
  202. *   FUNCTION
  203. *    The default extension of the file format will be returned
  204. *    as READ_ONLY, NULL terminated string which will be only valid
  205. *    as long as the library is opened.
  206. *   INPUTS
  207. *    
  208. *   RESULT
  209. *     ext - String pointer to the extension, or NULL no default.
  210. *   EXAMPLE
  211. *    ext = tdo3XExt();
  212. *
  213. *   NOTES
  214. *
  215. *   BUGS
  216. *   SEE ALSO
  217. ******************************************************************************
  218. *
  219. */
  220. STRPTR __saveds ASM tdo3XExt () {
  221.     static STRPTR ext="dm3";
  222.     return(ext);
  223. }
  224.  
  225. /****** geoa.library/tdo3XName ******************************************
  226. *   NAME    
  227. *     tdo3XName -- Returns the file format name string.
  228. *
  229. *   SYNOPSIS
  230. *    name = tdo3XName ( )
  231. *
  232. *    SRPTR tdo3XName
  233. *         ( );
  234. *
  235. *   FUNCTION
  236. *    The file format its name will be returned. This string should not 
  237. *    be to large, about 20 characters maximum.
  238. *    The string is READ_ONLY, NULL terminated and only valid as
  239. *    long as the library is opened.
  240. *   INPUTS
  241. *    
  242. *   RESULT
  243. *     name - String pointer to the name, or NULL no one.
  244. *   EXAMPLE
  245. *    name = tdo3XName();
  246. *
  247. *   NOTES
  248. *
  249. *   BUGS
  250. *   SEE ALSO
  251. ******************************************************************************
  252. *
  253. */
  254. STRPTR __saveds ASM tdo3XName () {
  255.     static STRPTR name="Dummy 3";
  256.  
  257.     return(name);
  258. }
  259.  
  260. /************************* End of file ******************************/
  261.